package com.control.qct.businesssteward.adapter;

import android.support.annotation.Nullable;

import com.control.qct.businesssteward.R;
import com.control.qct.businesssteward.model.PaymentDetailModel;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.control.qct.businesssteward.utils.DecimalFormatUtils;

import java.util.List;

/**
 * 付款明细适配器
 * Created by Administrator on 2017/12/3 0003.
 */

public class PaymentDetailAdapter extends BaseQuickAdapter<PaymentDetailModel, BaseViewHolder> {
    public PaymentDetailAdapter(@Nullable List<PaymentDetailModel> data) {
        super(R.layout.rv_pay_detail_item, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, PaymentDetailModel item) {
        holder.setImageResource(R.id.iv_pay_style, item.getImg()).setText(R.id.tv_pay_style_name, item.getName())
                .setText(R.id.tv_pay_cash, "￥" + DecimalFormatUtils.DecimalFormatTwo(item.getCash()));
    }
}
